#pragma once
#include <iostream>
using namespace std;
#define maxSize 101
int insertElement(int* arr, int& length, int p, int e) {
	if (p<0 || p>length || length == maxSize) {
		return 0;
	}
	for (int i = length - 1; i >= p; i--) {
		arr[i + 1] = arr[i];
	}
	arr[p] = e;
	length++;
	return 1;
}

int deleteElement(int* arr, int& length, int p, int& e) {
	if (p<0 || p>length - 1) {
		return 0;
	}
	e = arr[p];
	for (int i = p; i < length; i++) {
		arr[i] = arr[i + 1];
	}
	length--;
	return e;
}